﻿#include "TableWidget_DeviceList.h"
#include "ui_TableWidget_DeviceList.h"

#include <qheaderview.h>

TableWidget_DeviceList::TableWidget_DeviceList(QWidget *parent) :
  QTableWidget(parent),
  ui(new Ui::TableWidget_DeviceList)
{
  ui->setupUi(this);
  QHeaderView * header_tableWidget_deviceList=horizontalHeader();
  header_tableWidget_deviceList->setSectionsClickable(false);
  header_tableWidget_deviceList->setStyleSheet("QHeaderView::section{background-color:lightgray;border: 1px solid silver;}");
}

TableWidget_DeviceList::~TableWidget_DeviceList()
{
  delete ui;
}

void TableWidget_DeviceList::resizeEvent(QResizeEvent * event)
{
  QTableWidget::resizeEvent(event);
  int mateWidth_tableWidget_deviceList=width()/7;
  QHeaderView * header_tableWidget_deviceList=horizontalHeader();
  header_tableWidget_deviceList->resizeSection(0,2*mateWidth_tableWidget_deviceList);
  header_tableWidget_deviceList->resizeSection(1,mateWidth_tableWidget_deviceList);
  header_tableWidget_deviceList->resizeSection(2,mateWidth_tableWidget_deviceList);
  header_tableWidget_deviceList->resizeSection(3,mateWidth_tableWidget_deviceList);
  header_tableWidget_deviceList->resizeSection(4,mateWidth_tableWidget_deviceList);
  header_tableWidget_deviceList->resizeSection(5,mateWidth_tableWidget_deviceList);
}
